package dao.impl;

import dao.UserDao;
import entity.User;
import util.JdbcUtil;

import java.sql.SQLException;

public class UserDaoImpl implements UserDao {

    @Override
    public User login(String username, String pwd) throws SQLException {
        try {
            return JdbcUtil.queryOne(User.class,
                    "select * from t_user where username = ? and pwd = ?",
                    username, pwd);
        } catch (SQLException e) {
            throw new RuntimeException(e);
        }
    }
}
